home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / doors / asl / asl.c next >
Encoding:
C/C++ Source or Header  |  1992-12-26  |  1.8 KB  |  76 lines

  1. #include <exec/exec.h>
  2. #include <intuition/intuition.h>
  3. #include <intuition/screens.h>
  4. #include <graphics/displayinfo.h>
  5. #include <libraries/asl.h>
  6. #include <workbench/startup.h>
  7.  
  8. #include <clib/asl_protos.h>
  9. #include <clib/exec_protos.h>
  10. #include <clib/intuition_protos.h>
  11. #include <stdio.h>
  12.  
  13. #include "XIM:glue.h"
  14. #include "XIM:doorheader.h"
  15. struct Library *AslBase = NULL;
  16. struct Library *IntuitionBase = NULL;
  17. struct Screen *screen=NULL;
  18. struct Window *window=NULL;
  19.  
  20. void LastCommand(void);
  21. void end(void);
  22. char temp[200];
  23.  
  24. #define gu getuserstring
  25. #define sm sendmessage
  26. void main(int argc,char **argv)
  27. {
  28.    struct FileRequester *fr;
  29.    struct WBArg *frargs;
  30.    int x;
  31.    Register(argv[1][0]-'0');
  32.    gu(temp,RAWSCREEN_ADDRESS);
  33.    screen=(struct Screen *)atol(temp);
  34.    AslBase=OpenLibrary("asl.library",0L);
  35.    IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0L);
  36.    window=(struct Window *)screen->FirstWindow;
  37.    fr=(struct FileRequestor *)AllocAslRequestTags(ASL_FileRequest,
  38.        ASL_Hail,(ULONG)"FilePat/MultiSelect Demo",
  39.        ASL_Dir,(ULONG)"libs:",
  40.        ASL_File,(ULONG)"asl.library",
  41.        ASL_Pattern,(ULONG)"#?",
  42.        ASL_FuncFlags, FILF_MULTISELECT|FILF_PATGAD,
  43.        ASL_Window, window,
  44.        TAG_DONE);
  45.  
  46.    if(AslRequest(fr,0L))
  47.    {
  48.         if(fr->rf_NumArgs)
  49.         {
  50.          frargs=fr->rf_ArgList;
  51.   
  52.           for(x=0;x<fr->rf_NumArgs;x++){
  53.             sprintf(temp,"Argument %d: PATH=%s FILE=%s",
  54.                x,fr->rf_Dir,frargs[x].wa_Name);sm(temp,1); }
  55.         }
  56.         else {
  57.          sprintf(temp,"PATH=%s FILE=%s",fr->rf_Dir,fr->rf_File);
  58.          sm(temp,1); }
  59.     }
  60.     FreeAslRequest(fr);
  61.     CloseLibrary(IntuitionBase);
  62.     CloseLibrary(AslBase);
  63.     ShutDown();
  64.     end();
  65. }
  66.  
  67. void LastCommand(void)
  68. {
  69.   sm("",1);
  70.   sm("",1);
  71. }
  72.  
  73. void end(void)
  74. {
  75.   exit(0);
  76. }